# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=wifi-monitor
pkgver=30.0657e48
pkgrel=3
groups=('blackarch' 'blackarch-sniffer')
pkgdesc="Prints the IPs on your local network that're sending the most packets."
url='https://github.com/DanMcInerney/wifi-monitor'
arch=('any')
license=('custom')
depends=('python2' 'python2-scapy' 'nbtscan' 'aircrack-ng')
makedepends=('git')
source=("git+https://github.com/DanMcInerney/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  find . -type f -name '*.py' -exec sed -i \
    's|#!.*/usr/bin/python|#!/usr/bin/python2|;s|#!.*/usr/bin/env python$|#!/usr/bin/env python2|' {} \;
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

